
 
 F u n c t i o n :   g e t O r i e n t a t i o n ( a r r a y O f E l e m e n t s ) 
 
 
 
 D e s c r i p t i o n :   T h e   g e t O r i e n t a t i o n ( )   f u n c t i o n   w i l l   c o m p u t e   t h e   v i s u a l   l a y o u t   o f   a n   a r r a y   o f   D O M   e l e m e n t s   t o   d e t e r m i n e   i f   t h e y   a r e   r e n d e r e d   h o r i z o n t a l l y   o r   v e r t i c a l l y . 
 
 
 
 R e t u r n s :   O b j e c t . 
 
 
 
 N o t e :   T h e   r e t u r n e d   o b j e c t   i n c l u d e s   2   p r o p e r t i e s ,   " o r i e n t a t i o n "   a n d   " l i n e W r a p " .   T h e   l i n e W r a p   p r o p e r t y   i s   a   b o o l e a n   v a l u e   c o n f i r m i n g   i f   t h e   s p e c i f i e d   e l e m e n t s   a r e   p o s i t i o n e d   h o r i z o n t a l l y   b u t   a l s o   w r a p   o n t o   d i f f e r e n t   l i n e s .   D e p e n d i n g   o n   t h e   r e s u l t   o f   t h e   c a l c u l a t i o n ,   t h e   o r i e n t a t i o n   p r o p e r t y   w i l l   i n c l u d e   a   s t r i n g   v a l u e   s t a t i n g   e i t h e r   " h o r i z o n t a l "   o r   " v e r t i c a l " .   T h i s   f u n c t i o n a l i t y   i s   m e a n t   t o   c o n t r o l   k e y b o a r d   h a n d l i n g   a d j u s t m e n t s   f o r   i n t e r a c t i v e   w i d g e t s   t h a t   r e q u i r e   a r r o w   k e y   u s a g e   f o r   i n t e r n a l   n a v i g a t i o n . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   G e t   t h e   o r i e n t a t i o n   f o r   a n   a r r a y   o f   D O M   e l e m e n t s   r e n d e r e d   a d j a c e n t   t o   e a c h   o t h e r . 
 
 v a r   m y O r i e n t a t i o n   =   $ A . g e t O r i e n t a t i o n ( a r r a y O f E l e m e n t s ) ; 
 
 
 
 / /   G e t   t h e   o r i e n t a t i o n   f o r   a n   a r r a y   o f   D O M   e l e m e n t s   u s i n g   a   C S S   s e l e c t o r . 
 
 v a r   m y O r i e n t a t i o n   =   $ A . g e t O r i e n t a t i o n ( ' # m y M e n u [ r o l e = " m e n u " ]   >   * [ r o l e = " m e n u i t e m " ] ' ) ; 
 
 
 
 R e s u l t 
 
 
 
 m y O r i e n t a t i o n . o r i e n t a t i o n   / /   W i l l   b e   e i t h e r   " h o r i z o n t a l "   o r   " v e r t i c a l " . 
 
 
 
 m y O r i e n t a t i o n . l i n e W r a p   / /   W i l l   b e   e i t h e r   t r u e   o r   f a l s e . 
 
 
 
 / /   T h e   r e t u r n e d   v a l u e   o f   t h e   o r i e n t a t i o n   p r o p e r t y   i s   d e s i g n e d   t o   b e   d i r e c t l y   a p p l i c a b l e   t o   t h e   a r i a - o r i e n t a t i o n   a t t r i b u t e . 
 
 
 
 $ A ( m y M e n u ) . s e t A t t r i b u t e ( " a r i a - o r i e n t a t i o n " ,   m y O r i e n t a t i o n . o r i e n t a t i o n ) ; 
 
 